package uk.co.cdal.cobweb.backend;

import java.net.InetAddress;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.ArrayList;

import javax.swing.ImageIcon;

import uk.co.cdal.cobweb.shared.Idea;

public interface Backend extends Remote {

	public static final String rmiName = "backend";
	

	
	public Backend getParent() throws RemoteException;
	
	public Backend getChild0() throws RemoteException;
	
	public Backend getChild1() throws RemoteException;
	
	public Backend getSibling() throws RemoteException;
	
	public ArrayList<String> panic() throws RemoteException;
	
	public void setMe(Backend inPlace, InetAddress addr) throws RemoteException;
	
	public Idea requestIdea(String ideaId) throws RemoteException;

	public boolean stillThere() throws RemoteException;

	public InetAddress getAddress() throws RemoteException;
	
	public void connect(InetAddress addr) throws RemoteException;
	
	public long getAvgConnectionTime(Backend b) throws RemoteException;
	
	public void addIdea(Idea i, InetAddress addr) throws RemoteException;
	
	public void removeIdea(Idea i, InetAddress addr) throws RemoteException;
	
	public void addURL(String URL, Idea i, InetAddress from) throws RemoteException;
	
	public void removeURL(String URL, Idea i, InetAddress from) throws RemoteException;
	
	public void addImage(ImageIcon image, Idea i, InetAddress from) throws RemoteException;
	
	public void updateTitle(String title, Idea i, InetAddress addr) throws RemoteException;
	
	public void sendMessage(String from, String message, String date) throws RemoteException;
	
	public void removeImage(ImageIcon image, Idea i, InetAddress from) throws RemoteException;
	
	public void updateFurtherText(String futherText, Idea i, InetAddress addr) throws RemoteException;
	
}
